<template>
	<div class="audit-wrapper">
		<div class="head">
			<span class="title">
				{{ $t('funds.fund_audit.rebate_check_detail_title') }}
			</span>
			<div class="right-btn">
				<el-button plain @click="goBack">
					{{ $t('common.back') }}
				</el-button>
			</div>
		</div>
		<div class="audit-content detailBoxStyle flex-row-container">
			<div class="tree-box mr15">
				<CommonProxyTree
					ref="proxyTree"
					:selectedData.sync="selectedData"
					:detailData="detailData"
					:createdAtEnd="proxyCreatedAtEnd"
				/>
			</div>
			<div class="treeRight">
				<ProxyRebate
					v-if="selectedData.type === 1"
					:selectedData="selectedData"
					:detailData="detailData"
				/>
				<RebateBouns
					v-else
					:selectedData="selectedData"
					:detailData="detailData"
				/>
			</div>
		</div>
	</div>
</template>

<script>
import list from '@/mixins/list'
import dayjs from 'dayjs'
import CommonProxyTree from '@/components/CommonProxyTree/index'
import RebateBouns from '@/components/Funds/RebateBouns'
import ProxyRebate from '@/components/Funds/ProxyRebate'
export default {
	components: {
		CommonProxyTree,
		RebateBouns,
		ProxyRebate
	},
	mixins: [list],
	props: {
		detailData: {
			type: Object,
			required: true
		}
	},
	data() {
		return {
			selectedData: {
				type: 1,
				userName: ''
			}
		}
	},
	computed: {
		proxyCreatedAtEnd() {
			return dayjs(String(this.detailData?.cycleEndDate)).format(
				'YYYY-MM-DD 23:59:59'
			)
		}
	},
	watch: {},
	created() {},
	methods: {
		tableRowClassName({ row, rowIndex }) {
			return row.level === this.rulesDialog.level ? 'high-light' : ''
		},
		goBack() {
			this.paramProxyId = undefined
			this.$emit('goBack')
		}
	}
}
</script>

<style lang="scss" scoped>
::v-deep .el-tabs__item {
	font-size: 16px;
	font-weight: bold;
}
.tree-box {
	width: 320px;
	flex-shrink: 0;
	height: auto;
	overflow: auto;
	::v-deep .el-card__body {
		padding-left: 0px;
		width: 100%;
	}
}
.treeRight {
	width: calc(100% - 245px);
	display: flex;
	-o-display: flex;
	-ms-display: flex;
	-webkit-display: flex;
	-moz-display: flex;
	flex-direction: column;
	-o-flex-direction: column;
	-ms-flex-direction: column;
	-webkit-flex-direction: column;
	-moz-flex-direction: column;
	overflow-y: auto;
	overflow-x: hidden;
}
.txtfeed {
	width: 160px;
	table-layout: fixed;
	word-break: break-all;
	overflow: hidden;
}
.audit-wrapper {
	color: #666666;
	margin: 24px 16px 20px 16px;
	.head {
		height: 70px;
		line-height: 70px;
		width: 100%;
		background: #000;
		border-radius: 2px;
		padding: 0 30px;
		.title {
			font-weight: 600;
			color: rgb(192, 190, 190);
		}
		.right-btn {
			float: right;
		}
	}

	.audit-content {
		.block {
			padding: 10px 30px 0px 30px;
			.name {
				font-weight: 600;
				color: #303133;
			}
			.block-content {
				position: relative;
				width: 100%;
				margin-top: 15px;
			}
		}
		.rebate-details {
			padding-bottom: 20px;
			.details-page {
				margin-top: 10px;
				position: absolute;
				right: 0;
			}
		}
	}
}

.count-single-row {
	height: 40px;
	p {
		height: 40px;
		line-height: 40px;
		color: #5c5c5c;
		font-weight: 700;
		span {
			display: inline-block;
			width: 20px;
			height: 20px;
		}
	}
}

.audit-dialog {
	::v-deep .el-dialog__header {
		color: #909399;
		font-weight: 700;
		text-align: left;
	}
}

.active-dialog {
	::v-deep .el-dialog__header {
		padding: 10px 20px 10px;
	}
	::v-deep .el-dialog__body {
		padding: 20px 20px;
	}
	.tabs-wrapper {
		display: flex;
		.tab {
			width: 120px;
			height: 40px;
			line-height: 40px;
			text-align: center;
			border: 1px solid rgba(0, 0, 0, 0.15);
			font-size: 14px;
			font-weight: 600;
			color: #000000a3;
			cursor: pointer;
			margin-right: 20px;
		}
	}
	.active {
		background: #00bfbf;
	}
	.type-name {
		padding: 0 0 20px;
		font-weight: 600;
		.num {
			color: blue;
		}
	}
}
::v-deep .el-table {
	.high-light {
		color: #0dc5e3;
	}
}
.detailBoxStyle {
	border: none !important;
	margin-top: 10px;
	overflow: hidden;
}
</style>
